export default function controlSeniorBoxDialog(state, { e, that }) {
  let seniorBox = JSON.parse(JSON.stringify(state.componentList["seniorBox"]));
  let num = e.path.reverse()[9].className;
  that.seniorBoxDialog = false;

  seniorBox.attrs.class = `seniorBox${new Date().getTime()} NO${num}`;
  seniorBox.num = num;
  seniorBox.children = JSON.parse(JSON.stringify(state.seniorBoxList[num]));

  state.domStackNum += 1;
  state.domStack.splice(state.domStackNum);

  state.domStack.push({
    type: "add",
    pageName: that.pageName,
    data: [seniorBox, state.page.tree[that.pageName].length],
    path: [
      {
        className: seniorBox.attrs.class,
      },
    ],
  });

  state.page.tree[that.pageName].push(seniorBox);

  // console.log(e.path, e.path.reverse()[9].className);
}
